package com.itheima03;

import java.io.File;

public class Test01 {
    public static void main(String[] args) {
        File file = new File("E:\\");
        printName(file);
    }

    public static void printName(File file) {
        File[] files = file.listFiles();
        if (files == null){
            return;
        }
        for (File file1 : files) {
            String name = file1.getName();
            if (file1.isFile()&&name.endsWith(".png")||name.endsWith(".jpd")){
                System.out.println(file1.getAbsolutePath());
            }else{
                printName(file1);
            }
        }
    }
}
